package com.loongtech.bi.manager.game;

import com.loongtech.bi.entity.game.EntityActiveRoleNumByVipAndLevel;
import com.loongtech.core.jpa.manager.ManagerQueryCacheBase;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ActiveRoleNumByVipandLevelManager extends ManagerQueryCacheBase<EntityActiveRoleNumByVipAndLevel> {
	private static final long serialVersionUID = 1L;

    public List<EntityActiveRoleNumByVipAndLevel> getDatas(Date dayStart, Date dayEnd,String queryPlatform, String queryChannel, String queryServer) {
        return findByQuery("from EntityActiveRoleNumByVipAndLevel where " +
                        "day>=:dayStart and day<=:dayEnd and platformid=:queryPlatform and channelid=:queryChannel and serverid=:queryServer " +
                        "order by day, viplevel, level ",
                "dayStart", dayStart, "dayEnd", dayEnd, "queryPlatform", queryPlatform, "queryChannel", queryChannel, "queryServer", queryServer);
    }

    public List<EntityActiveRoleNumByVipAndLevel> getDatasByVipLevel(Date dayStart, Date dayEnd,String queryPlatform, String queryChannel, String queryServer, List<Integer> viplevels) {
        return findByQuery("from EntityActiveRoleNumByVipAndLevel where " +
                        "day>=:dayStart and day<=:dayEnd and platformid=:queryPlatform and channelid=:queryChannel and serverid=:queryServer and " +
                        "viplevel in (:viplevels) order by day, viplevel, level ",
                "dayStart", dayStart, "dayEnd", dayEnd, "queryPlatform", queryPlatform, "queryChannel", queryChannel, "queryServer", queryServer, "viplevels", viplevels);
    }
}
